<script setup>
import { defineProps, reactive } from 'vue'
import icon4 from '@/assets/qrcode/icon4.png'
import icon5 from '@/assets/qrcode/icon5.png'
import icon6 from '@/assets/qrcode/icon6.png'
import icon7 from '@/assets/qrcode/icon7.png'

const props = defineProps({
  list: {
    type: Array,
    default: () => [],
  },
})

const iconList = reactive([icon4, icon5, icon6, icon7])
</script>

<template>
  <div class="fixedPlace">
    <div class="title">固定场所扫码统计</div>

    <div class="placeList">
      <div v-for="(item, index) in props.list" :key="index" class="placeItem">
        <img :src="iconList[index]" class="icon" />

        <div class="place">{{ item.placeCategory }}</div>

        <div class="placeNum">
          <div class="name">场所数</div>
          <div class="num">{{ item.placeNum }} <span class="unit">个</span></div>
        </div>

        <div class="codeNum">
          <div class="name">扫码数</div>
          <div class="num">{{ item.scanNum }} <span class="unit">个</span></div>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="less" scoped>
.fixedPlace {
  width: 340px;
  height: 546px;
  background-image: url('@/assets/qrcode/boxbg3.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;

  .title {
    margin-top: 8px;
    width: 100%;
    height: 20px;
    font-size: 14px;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .placeList {
    flex: 1;
    margin: 40px 29px 40px 35px;

    .placeItem {
      display: flex;
      align-items: center;

      &:not(:first-child) {
        margin-top: 79px;
      }

      .icon {
        width: 50px;
        height: 50px;
      }

      .place {
        font-size: 18px;
        font-weight: 600;
        color: #fefefe;
        margin: 0 20px;
      }

      .placeNum,
      .codeNum {
        flex: 1;

        .name {
          height: 20px;
          font-size: 14px;
          font-weight: 400;
          color: #ffffff;
        }

        .num {
          margin-top: 2px;
          height: 22px;
          font-size: 16px;
          font-weight: 600;
          color: #62ceb2;

          .unit {
            color: #ffffff;
          }
        }
      }

      .codeNum {
        .num {
          color: #08baf9;
        }
      }
    }
  }
}
.showHeader {
  color: white;
  height: 142px;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  .showHeaderItem {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 120.5px;
    width: 122px;
  }
  .circle {
    width: 90px;
    height: 90px;
    line-height: 90px;
    text-align: center;
    background-image: url('../../../assets/921.png');
    background-size: 100% 100%;
    font-size: 16px;
    font-weight: bold;
  }
  .bot {
    font-size: 14px;
    .tips {
      font-size: 16px;
    }
  }
}
.centerImg {
  position: relative;
  margin-top: 23px;
  height: 431px;
  background-image: url('../../../assets/920.png');
  background-size: 590px 431px;
  background-repeat: no-repeat;
  background-position: center;
  font-size: 16px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;

  .centerPie {
    position: absolute;
    width: 250px;
    height: 250px;
  }
  .centerInfo {
    width: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    .line1 {
      color: white;
      font-size: 14px;
      .pcount {
        display: inline-block;
        text-align: center;
      }
      .pcountPading {
        padding-right: 20px;
      }
    }
  }
}
.font16 {
  font-size: 23px;
  font-weight: 600;
}
.font14 {
  color: white;
  font-size: 18px;
  font-weight: 600;
}
.font20 {
  font-size: 37px;
  font-weight: 600;
}
.centerBto {
  height: calc(100% - 166px - 431px);
  background-image: url('../../../assets/1020.png');
  background-size: 100% 100%;
  .btoText {
    color: white;
    font-size: 14px;
    height: 32px;
    line-height: 28px;
    text-align: center;
  }
}
</style>
